import request from "@/utils/request";

// 获取玩家信息
export function getPlayers(account_id) {
  return request({
    url: `/api/players/${account_id}`,
    method: "get"
  });
}

// 获取玩家胜负场
export function getPlayersWl(account_id) {
  return request({
    url: `/api/players/${account_id}/wl`,
    method: "get"
  });
}

// 获取玩家统计
export function getPlayerTotals(account_id, params) {
  return request({
    url: `/api/players/${account_id}/totals`,
    method: "get",
    params
  });
}

// 获取玩家最近游戏
export function getPlayerRecentMatches(account_id) {
  return request({
    url: `/api/players/${account_id}/recentMatches`,
    method: "get"
  });
}

// 获取玩家所有游戏
export function getPlayerMatches(account_id, params) {
  return request({
    url: `/api/players/${account_id}/matches`,
    method: "get",
    params
  });
}

// 获取玩家词云
export function getPlayerWordCloud(account_id) {
  return request({
    url: `/api/players/${account_id}/wordcloud`,
    method: "get"
  });
}

// 获取玩家历史姓名 段位
export function getPlayerHistory(account_id) {
  return request({
    baseURL: "https://api.stratz.com/api/v1/",
    url: `/Player/${account_id}`,
    method: "get",
    headers: {
      authorization:
        "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiJodHRwczovL3N0ZWFtY29tbXVuaXR5LmNvbS9vcGVuaWQvaWQvNzY1NjExOTgxNDkxMjU0NjMiLCJ1bmlxdWVfbmFtZSI6Ik9L6IKl5LuUIiwiU3ViamVjdCI6IjAyOTVmMzEwLWMyY2ItNGM3NC1hN2I0LTZjZDliNTk1ZDIzZCIsIlN0ZWFtSWQiOiIxODg4NTk3MzUiLCJuYmYiOjE2Mzk2MjA0OTYsImV4cCI6MTY3MTE1NjQ5NiwiaWF0IjoxNjM5NjIwNDk2LCJpc3MiOiJodHRwczovL2FwaS5zdHJhdHouY29tIn0.eD9LWerYIMV9NPYgCcr_1ewQ9wk48ofbcnZ2airmwSM"
    }
  });
}

// 获取玩家眼位数据
export function getPlayerWardmap(account_id) {
  return request({
    url: `/api/players/${account_id}/wardmap`,
    method: "get"
  });
}

// 获取玩家好友数据
export function getPlayerPeers(account_id, params) {
  return request({
    url: `/api/players/${account_id}/peers`,
    method: "get",
    params
  });
}

// 获取玩家英雄数据
export function getPlayerHeros(account_id) {
  return request({
    url: `/api/players/${account_id}/heroes`,
    method: "get"
  });
}

// 获取玩家英雄分
export function getPlayerRankings(account_id) {
  return request({
    url: `/api/players/${account_id}/rankings`,
    method: "get"
  });
}

export function getPlayerCounts(account_id, params) {
  return request({
    url: `/api/players/${account_id}/counts`,
    method: "get",
    params
  });
}
